package com.cljz.makepassenger.ui.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.cljz.makepassenger.base.App;
import com.cljz.makepassenger.R;
import com.cljz.makepassenger.model.net.bean.InvitationBean;
import com.squareup.picasso.Picasso;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by apple on 2017/4/10.
 */

public class LetterBgHolder extends RecyclerView.ViewHolder {
    public LetterBgHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);
    }

    @BindView(R.id.iv_bg)
    ImageView ivBg;
    @BindView(R.id.iv_pitch_on)
    ImageView ivPitchOn;
    @BindView(R.id.rl_down)
    RelativeLayout rlDown;

    public void setData(List<InvitationBean.DataBean> invitations, int position, String selectId) {
        InvitationBean.DataBean invitation = invitations.get(position);
        Picasso.with(App.getInstance()).load(invitation.getAd_logo()).into(ivBg);
        rlDown.setAlpha(0.6f);
        if (selectId.equals(invitation.getId())) {
            ivPitchOn.setVisibility(View.VISIBLE);
//            rlDown.setVisibility(View.VISIBLE);
        } else {
            ivPitchOn.setVisibility(View.GONE);
//            rlDown.setVisibility(View.GONE);
        }

    }
}
